<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<title>用户登录</title>
<link rel="stylesheet" href="/static/layui/css/layui.css">
<link rel="stylesheet" href="/static/admin/css/main.css">
<script src="/static/layui/layui.js"></script>
<script>
	layui.use(['form','jquery','layer'], function() {
		
		var form = layui.form;
		var layer = layui.layer;
		var $ = layui.jquery;

		form.on('submit(form_Login)', function(data) {
			
			$.ajax({
				url:"login_action",
				method:"POST",
				data:data.field,
				success:function(res){
					if(res.code==1){
						location.href="/admin"
					}else{
						layer.msg(res.msg);
					}					
				}
			})

			return false
		})

	})
</script>
</head>
<body>

	<div class="layui-container">
		<div class="layui-row">
			<div class="layui-col-md6 layui-col-md-offset3">
				<div class="login_form">
					<div class="form_title">
						<h2>创作者登录窗口</h2>
					</div>
					<form class="layui-form" action="">
						<div class="layui-form-item">
							<label class="layui-form-label">账户名</label>
							<div class="layui-input-block">
								<input type="text" name="username" required lay-verify="required"
									placeholder="请输入账户名" autocomplete="off" class="layui-input">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">密码</label>
							<div class="layui-input-inline">
								<input type="password" name="password" required
									lay-verify="required" placeholder="请输入密码" autocomplete="off"
									class="layui-input">
							</div>
							<div class="layui-form-mid layui-word-aux">辅助文字</div>
						</div>

						<div class="layui-form-item">
							<label class="layui-form-label">记住密码</label>
							<div class="layui-input-block">
								<input type="checkbox" name="record" lay-skin="switch">
							</div>
						</div>

						<div class="layui-form-item">
							<div class="layui-input-block">
								<button class="layui-btn" lay-submit lay-filter="form_Login">登录</button>
								<button type="reset" class="layui-btn layui-btn-primary">重置</button>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>

</body>
</html>